<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery-3.7.1.min.js"></script>
    <style>
        #box{
            width:200px;
            height:200px;
            background-color:lightblue;
        }
        #container{
            width:200px;
            height:200px;
            background-color:lightgreen;
            display: none;

        }
    </style>
</head>
<body>
    <button id="btn">按钮</button>
    <div id="box"></div>
    <div id="container"></div>

    <script>

        $('#btn').click(function(){
            console.log('按钮被点击了')
        })

        //hover 事件 鼠标移入移出
        $('#box').hover(
                function(){
                    console.log('鼠标进入了')
                    $('#container').css('display','block')
                },
                function(){
                    console.log('鼠标离开了')
                    $('#container').css('display','none')
                }
        )

        // 鼠标进入 鼠标移出
        $('#box').mouseenter(function(){
            console.log('鼠标进入了')
        })
        $('#box').mouseleave(function(){
            console.log('鼠标离开了')
        })


    </script>
</body>
</html>